<template>
	<view>
		<view class="order">
			<view class="row" style="display: flex;justify-content: space-between; align-items: center;">
				<view class="left" >
					<text >下单成功</text>
				
				</view>
					<text style="font-weight: bold;font-size: 30rpx;">请耐心等待快递上门取件</text>
			</view>
		</view>
		<view class="order">
			<view class="row">
				<view class="left">
					预估重量
				</view>
				<view class="right">
					{{order.weight}}公斤
				</view>
			</view>
		</view>
		<view class="order" v-if="order.real_weight">
			<view class="row">
				<view class="left">
					实际重量
				</view>
				<view class="right">
					{{order.real_weight}}公斤
				</view>
			</view>
		</view>
		<view class="order">
			<view class="row">
				<view class="left">
					预约上门时间
				</view>
				<view class="right">
					{{order.recycle_time}}
				</view>
			</view>
		</view>
		<!-- 收货地址 -->
		<view class="addr">
			<view class="top-title">
				<text class="time">预约信息</text>
			</view>
			<view class="top">
				<image src="/static/img/ad.png" mode=""></image>
			</view>
			<view class="info">
				<view class="icon">
					<image src="/static/img/dttb.png" mode=""></image>
				</view>
				<view class="right">
					<view class="tel-name">
						<view class="name">
							{{address.username}}
						</view>
						<view class="tel">
							{{address.phone}}
						</view>
					</view>
					<view class="addres">
						{{address.recycle_address}}
						{{address.address}}
					</view>
				</view>
			</view>
		</view>

		<view class="addr">
			<view class="top-title">
				<text class="time">订单信息</text>
			</view>
			<view class="invoice">
				<view class="row">
					<view class="nominal">
						订单号
					</view>
					<view class="input">
						{{order.order_sn}}
					</view>
				</view>
				<view class="row">
					<view class="nominal">
						订单状态
					</view>
					<view class="input">
						<text v-if="order.state == 1">待服务</text>
						<text v-if="order.state == 2">已受理</text>
						<text v-if="order.state == 3">取件成功</text>
						<text v-if="order.state == 4">取件失败</text>
						<text v-if="order.state == 5">已取消</text>
						<text v-if="order.state == 6">已完成</text>
					</view>
				</view>
				<view class="row">
					<view class="nominal">
						下单时间
					</view>
					<view class="input">
						{{order.ctime}}
					</view>
				</view>
				<view class="row" v-if="order.kd_waybill_no">
					<view class="nominal">
						快递单号
					</view>
					<view class="input">
						{{order.kd_waybill_no}}
					</view>
				</view>
				<view class="row" v-if="order.kd_waybill_mobile">
					<view class="nominal">
						快递小哥号码
					</view>
					<view class="input">
						{{order.kd_waybill_mobile}}
					</view>
				</view>
				<view class="row" v-if="order.total_money">
					<view class="nominal">
						订单回收金额
					</view>
					<view class="input" style="color: red; font-size: 30rpx; font-weight: bold;">
						{{order.total_money}}元
					</view>
				</view>

			</view>
		</view>

		<!-- 提示-备注 -->
		<view class="note">
			<view class="title">
				注意事项 :
			</view>
			<view class="info">
				<text>1.服务时间：回收员会第一时间与您确定上门服务时间，请确保手机畅通</text>
				<text>2.订单结算：回收员当场完成服务时，会根据品类、重量通过平台跟您结算到您的衣之光小程序账户</text>
				<text>3.免费赠送订单：回收员在完成订单后将不会支付费用请知悉</text>
			</view>
		</view>
		
		<button class="action-btn recom" @click="toDetail()">催促取件</button>
		<view style="height: 40rpx;"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				order: '',
				address: '',
			}
		},
		onLoad(options) {
			var order_sn = options.order_sn;

			this.$api.http.get('order-detail', {
				order_sn: order_sn
			}).then(res => {
				if (res) {
					this.order = res.data.list;
					this.address = res.data.list.addr;
				}
			})
		},
		methods: {
			toDetail(){
				this.$api.msg('正在催促取件，请耐心等待');
			}
		}
	}
</script>

<style lang="scss">
	page {
		position: relative;
		background-color: #f2f2f2;
	}

	.top-title {
		height: 80rpx;
		line-height: 80rpx;
		padding: 0 30rpx;
		font-size: 30rpx;
		font-weight: bold;
		color: #333;
	}

	.addr {
		background: #fff;
		margin-top: 20rpx;

		.top {
			height: 10rpx;

			image {
				height: 7upx;
				width: 100%;
				vertical-align: top;
			}
		}

		.info {
			padding: 20rpx 30rpx;
			display: flex;
			position: relative;

			.right {
				width: 100%;
			}

			.icon {
				width: 60upx;
				height: 75upx;
				display: flex;
				align-items: center;

				image {
					width: 40upx;
					height: 40upx;
				}
			}

			.size {
				width: 100%;
				font-size: 24upx;
				align-items: baseline;
				color: #777;
				margin-top: 10rpx;

				view {
					display: block;

					text {
						width: 50%;
						float: left;
						font-size: 26rpx;
						line-height: 40rpx;
					}

					text.two {
						width: 100%;
					}
				}
			}

			.tel-name {
				width: 100%;
				display: flex;
				font-size: 28upx;

				.tel {
					margin-left: 40upx;
				}

				.radio {
					display: flex;
					width: 110rpx;
					margin-left: 30rpx;

					.center {
						padding-left: 15rpx;
					}

					radio[disabled] {
						color: #0086E7 !important;
					}
				}
			}

			.addres {
				width: 100%;
				font-size: 26upx;
				color: #999;
			}
		}
	}
	.action-btn {
			width: 160upx;
			height: 60upx;
			margin: 0;
			margin-left: 24upx;
			padding: 0;
			text-align: center;
			line-height: 60upx;
			font-size: 24upx;
				background: linear-gradient(90deg, #0fD0C3, #3ebcc5);
			border-radius: 100px;
			color: #fff;

		}
	.order {
		width: 94%;
		padding: 10upx 3%;
		margin: 20upx auto;
		background: #fff;

		.row {
			margin: 20upx 0;
			height: 60upx;
			display: flex;
			justify-content: space-between;

			.left {
				font-size: 28upx;
				line-height: 60upx;
			}

			.right {
				margin-left: 40upx;
				font-size: 26upx;
				color: #999;
				line-height: 35px;

				input {
					font-size: 26upx;
					color: #999;
					line-height: 60upx;
					height: 60rpx;

				}
			}
		}
	}

	.order-item {
		display: flex;
		flex-direction: column;
		background: #fff;
		margin: 16upx 0 0;

		.goods-box-single {
			display: flex;
			padding: 25rpx 30rpx;
			align-items: center;
			justify-content: flex-start;
			border-bottom: 1px solid #eee;

			.goods-img {
				display: block;
				width: 100rpx;
				height: 100rpx;
				border-radius: 50%;
			}

			.title {
				font-size: 26rpx;
				color: #333;
				line-height: 35rpx;
				overflow: hidden;
				padding-left: 37rpx;
			}
		}
	}

	.invoice {
		display: flex;
		flex-wrap: wrap;
		border-top: solid 1rpx #eee;

		view {
			display: flex;
		}

		.row {
			width: 100%;
			padding: 0 30rpx;
			border-bottom: solid 1upx #eee;
			justify-content: space-between;

			.nominal {
				height: 95upx;
				font-size: 28upx;
				align-items: center;
			}

			.input {
				padding: 10upx 0;
				align-items: center;
				font-size: 28upx;

				&.switch {
					justify-content: flex-end;
				}

				input {
					font-size: 28upx;
				}
			}
		}
	}

	.note {
		width: 94%;
		padding: 25upx 3%;
		margin: 20upx auto;
		background: #fff;
		line-height: 40rpx;

		.title {
			font-size: 26rpx;
			color: #666;
			margin-bottom: 10rpx;
			color: red;
		}

		.info {
			font-size: 26rpx;
			color: #666;

			text {
				display: block;
				margin-bottom: 10rpx;
			}
		}
	}
</style>